<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // const Person = function () {
        //   this.name = 'mmm';
        //   // 实例化后在实例本身上
        //   this.tArr = []
        // }
        // Person.prototype = {
        //   // 实例化后在市里的原型链上
        //   arr: []
        // }
        // // const mmm = new Person();
        // // Person.prototype = { age: 18 }
        // // console.log(mmm)

        // const person1 = new Person();
        // const person2 = new Person();
        // person1.arr.push(111);
        // person1.tArr.push(111);
        // console.log(person1, person2)
        // console.log(person1.arr === person2.arr)
        // console.log(person1.tArr === person2.tArr)


        function Teacher() {
            this.a = 1;
        }
        Teacher.prototype.b = 2;

        function Person() {
            this.c = 3
        }
        const teacher = new Teacher();
        Person.prototype = new Teacher();
        Person.prototype.d = 4;
        Person.prototype.__proto__.e = 5
        console.log(new Person())
        console.log(Teacher.prototype)
        console.log(teacher)
    </script>

</body>

</html>